The present invention relates to the field of data storage for computer systems. More particularly, the present invention relates to the field of migrating data between storage devices in a computer system so as to conserve resources, such as power.
Computer systems typically include both random access memory (RAM) and magnetic disk memory. Each of these memory devices has its advantages and disadvantages. For example, RAM is generally more expensive than disk memory, but also has lower read and write latencies.
Conventional methods for moving data between RAM and disk memory devices in a computer system take into account some these relative strengths. More particularly, a conventional method moves blocks of data between RAM and disk memory based solely on a single parameter, a re-use xe2x80x9cvalue,xe2x80x9d for each block of data. Typically, the reuse value for a particular block of data is computed based on historical use of the block; those blocks that require more frequent access have higher reuse values. The reuse value for each block is compared to that of other data blocks. Those blocks that require more frequent access are placed in RAM while the remaining blocks are stored in disk memory. When the reuse value for a block in disk memory exceeds that of a block in RAM, the block from disk memory replaces the block in RAM. This method, however, does not take power consumption into consideration. Nor does this technique take into account the amount of time an unused block remains in RAM; rather, unused blocks remain in RAM based solely on how quickly an alternative block is available to replace it.
For battery-powered systems, such as laptop computers, it is generally desired to minimize power consumption so as to maximize usage between battery recharges. A feature of magnetic disk storage that is conventionally exploited in battery-powered systems is placement of the disk into standby mode to reduce power consumption. Typically, a disk in standby mode is xe2x80x9cspun-downxe2x80x9d to conserve power which would otherwise be used to keep the disk spinning. When the disk needs to be read from or written to, it is necessary to then xe2x80x9cspin-upxe2x80x9d the disk. In order to amortize the amount of power required to spin-up the disk, the disk must have been maintained in the standby mode for at least a certain amount of time. In their paper entitled, xe2x80x9cAdaptive Disk Spin-down Policies for Mobile Computers,xe2x80x9d Second USENIX Symposium on Mobile and Location-Independent Computing, Ann Arbor, Mich. pp. 121-137 (April 1995), F. Douglis, P. Krishnan and B. Bershad describe a system in which algorithms attempt to maintain the disk in standby mode as much as possible while minimizing the frequency of spinning up the disk. This power-saving technique is limited, however, by the ability to amortize the power required to spin-up the disk.
In their paper entitled, xe2x80x9cEnergy-aware adaptation for mobile applications,xe2x80x9d ACM 1-58113-140-2/99/0012 (1999), J. Flinn and M. Satyanarayanan, discuss the use of application software that can dynamically modify its behavior to conserve energy in a mobile computer. This technique has a drawback in that power savings are generally achieved at the cost of fidelity, such as in display of graphics.
Another technique for conserving power in mobile computers involves the use of power management features of certain DRAM devices. In their paper entitled, xe2x80x9cPower Aware Page Allocation,xe2x80x9d Proceedings of the Ninth International Conference in Architectural Support for Programming Languages and Operating Systems (November 2000), A. Lebeck, X. Fan, H. Zeng and C. Ellis consider page allocation policies to complement the ability of the memory devices to adjust power modes. This technique has a drawback in that it requires specially-designed DRAM devices.
Yet another paper, xe2x80x9cStorage Alternatives for Mobile Computers,xe2x80x9d F. Douglis, R. Cxc3xa1ceres, F. Kaashoek, K. Li, B. Marsh and J. Tauber, Proceedings of the 1st USENIX Symposium on Operating Systems Design and Implementation, (OSDI ""94) Monterey, Calif., pages 25-37 (November 1994), discusses data storage for mobile computers. The authors investigate use of magnetic hard disks, flash memory disk emulators and flash memory cards for mobile computers. Flash memory is considered for replacing or augmenting disk memory, but no policies are suggested that would conserve power during periods in which data is idle.
Therefore, what is needed is a technique for migrating data between storage devices that does not suffer from the aforementioned drawbacks. More particularly, what is needed is such a technique in which power consumption is minimized. It is to these ends that the present invention is directed.
The invention is a technique for migrating data between storage devices for reducing power consumption. Unlike prior techniques for conserving power by spinning down a magnetic disk, the present invention migrates data based on the assumption that the disk is maintained spinning (e.g., in a server). Accordingly, the incremental power consumed by maintaining data on the disk is nominal in comparison to the amount of power required to store the data in volatile memory (e.g., RAM). Data placement is largely based on the goal of minimizing power consumption during periods when the data is not being accessed. Further, unlike conventional techniques in which data is removed from RAM only when a better candidate is available to replace the data, the present invention may move data from RAM regardless of whether replacement data is available. This is avoids consumption of power to maintain data in RAM that is idle. Thus, under certain conditions, the inventive technique for data migration in a computer system reduces power consumption in comparison to conventional algorithms.
In accordance with an aspect of the invention, data is migrated between storage devices in a computer system having a first memory device and a second memory device. The first memory device may require more power to maintain a data block valid than the second memory device. The data block is moved from the first memory device to the second memory device when an anticipated amount of time before a next access to the data block exceeds a predetermined threshold.
The data may be moved from the first memory device regardless of whether a replacement data block is available. The first memory device may include random access memory (RAM) while the second memory device may include a magnetic disk or flash memory. The magnetic disk may be maintained in its spinning condition. The first memory device may require repeated refreshing while the second memory device may not.
In accordance with another aspect of the invention, the first memory device, the second memory device and a third memory device are included in the computer system. A data block is moved from the first memory device to the second memory device in response to an anticipated time until a next access to the data block for reading or writing. Alternately, the data block is moved from the first memory device to the third memory device in response to an anticipated time until a next read access to the data block being different from an anticipated time until a next write access to the data block.
More particularly, the data block may be moved from the first memory device to the second memory device when the anticipated amount of time before a next read access to the data block exceeds a first predetermined threshold and an anticipated amount of time before the next write access to the data block exceeds a second predetermined threshold. Further, the data block may be moved from the first memory device to the third memory device when the anticipated amount of time before the next read access to the data block does not exceed the first predetermined threshold and the anticipated amount of time before the next write operation exceeds the second predetermined threshold.
The third memory device may include flash memory. Thus, the third memory device may have a write latency that is significantly higher than its read latency.
In accordance with yet another aspect of the invention, a data block is assigned to the first memory device of the computer system. An anticipated amount of time before a next write access to the data block is computed. The data block is removed from the first memory device when the anticipated amount of time until the next write access to the data block exceeds a first threshold. An anticipated amount of time before a next read access to the data block is computed. The data block is inserted into the second memory device when the anticipated time until the next read access to the data block exceeds a second threshold. Otherwise, the data block is inserted into the third memory device.